import { BaseFightLogic } from "../BaseFightLogic";
import { HurtTypeEnum } from "../enum/HurtTypeEnum";
import IBaseFight from "../fight/IBaseFight";
import IBaseInjureBullet from "../fight/IBaseInjureBullet";
import IFightAction from "../fight/IFightAction";
import RandomFilter from "../fightFilter/RandomFilter";
import IFightFilter from "./IFightFilter";

/*****************************
 *@file: EmptyAction
 *@author: 陈吕唐
 *@desc: 基础行动类
 *@date: 2024-02-29	15:14
 *****************************/
export default class BaseAction implements IFightAction {
    /****************************************************************************************************************
     *Readonly 常量
     ****************************************************************************************************************/
    /****************************************************************************************************************
     *Property 定义变量
     ****************************************************************************************************************/
    protected fight: BaseFightLogic = undefined!;
    /***************************************************************
     *PropertyUI 引用的控件
     ***************************************************************/
    /****************************************************************************************************************
     * Lifecycle 生命周期相关方法
     ****************************************************************************************************************/
    public constructor(value: BaseFightLogic) {
        this.fight = value;
    }
    /****************************************************************************************************************
     * Public 公有方法
     ****************************************************************************************************************/
    public action(): Promise<boolean> {
        console.warn(`进行空行动`)
        return Promise.resolve(false);
    }
    /****************************************************************************************************************
     * private 私有方法
     ****************************************************************************************************************/
    /**
     * 创建普通攻击子弹数据
     * @param fight 
     * @returns 
     */
    protected createNormalBullet(fight: IBaseFight = null): IBaseInjureBullet {
        let bullet: IBaseInjureBullet = { source: fight, value: fight.atk, type: HurtTypeEnum.NORMAL }
        return bullet;
    }

    /**
     * 创建默认查找战斗单位策略
     * @returns 
     */
    protected createDefaultFind(): IFightFilter {
        return new RandomFilter();
    }
    /****************************************************************************************************************
     * Property Get && Set 属性的 get && set 函数
     ****************************************************************************************************************/
}